package com.chmingx.boot.controller;

import com.chmingx.boot.bean.User;
import com.chmingx.boot.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class UserController {
    @Autowired
    UserService userService;

    @GetMapping("/user")
    public User getUserById(@RequestParam("id") int id) {
        return userService.getUserById(id);
    }
}
